package com.jar.exercise.多线程.AQS.CountDownLatch;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;

public class Demo {
        static CountDownLatch countDownLatch = new CountDownLatch(3);
    public static void main(String[] args) throws InterruptedException {
        CompletableFuture.runAsync(() -> {

            countDownLatch.countDown();
            countDownLatch.countDown();
            countDownLatch.countDown();
            System.out.println("子线程开始。。。");
        });
        countDownLatch.await();
        countDownLatch.await();


        System.out.println("祝线程开始。。");
    }
}
